import { Inject, Injectable } from '@nestjs/common';
import { Cron, CronExpression } from '@nestjs/schedule';
import { ApisService } from './apis/apis.service';

@Injectable()
export class TaskService {
  @Inject(ApisService)
  private apisService: ApisService
  // @Cron(CronExpression.EVERY_DAY_AT_8AM)
  // async handleCron1() {
  //   await this.apisService.createToutiao()
  // }

  // @Cron(CronExpression.EVERY_DAY_AT_5PM)
  // async handleCron2() {
  //   await this.apisService.createToutiao()
  // }
  // get history list
  @Cron(CronExpression.EVERY_DAY_AT_1AM)
  async handleCron3() {
    await this.apisService.createHistory()
  }
}
